<?php

Route::get('/post', 'PostController@index');
Route::get('/post/create', 'PostController@create');
Route::post('/post', 'PostController@store');
Route::get('/post/search', 'PostController@search');
Route::get('/post/{id}', 'PostController@show');
Route::get('/post/{id}/edit', 'PostController@edit');
Route::put('/post/{post}', 'PostController@update');
Route::put('/post/delete/{id}', 'PostController@delete');
Route::post('/post/img/upload', 'PostController@imageUpload');
Route::post('/post/comment', 'PostController@comment');
Route::post('/post/comment', 'PostController@comment');
Route::get('/post/{id}/zan', 'PostController@zan');
Route::get('/post/{id}/unzan', 'PostController@unzan');

// 个人主页
Route::get('/user/{id}', 'UserController@show');
Route::post('/user/{id}/fan', 'UserController@fan');
Route::post('/user/{id}/unfan', 'UserController@unfan');

// 个人设置
Route::get('/user/me/setting', 'UserController@setting');
Route::post('/user/me/setting', 'UserController@settingStore');

// 专题
Route::get('/topic/{id}', 'TopicController@show');
Route::get('/topic/{id}/submit', 'TopicController@submit');

Route::get('/login', "LoginController@index")->name('login');
Route::post('/login', "LoginController@login");
Route::get('/logout', "LoginController@logout");

Route::get('/register', "RegisterController@index");
Route::post('/register', "RegisterController@register");
Route::post('/excel/import','ExcelController@import');
Route::get('excel/export',['uses'=>'ExcelController@export']);
Route::get('/excel/test','ExcelController@test');
Route::get('/excel/fields','ExcelController@fields');
Route::resource('excel', 'ExcelController');

Route::resource('resource.class', 'ResourceTest');
Route::get('resource/{pid}/class', 'ResourceTest@test');
Route::get('/api/index.json', 'vueController@index');
Route::get('/api/detail.json', 'vueController@detail');
Route::get('/api/city.json', 'vueController@city');
